<!DOCTYPE html>
<html>
<!-- 学分完成情况统计 -->

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

    <script src="/static/js/echarts2.0.js"></script>
</head>

<body>
    
<div id="app" v-cloak>   
        <el-form label-position="right" ref="form" :inline="true" :model="formInline" class="demo-form-inline"
            style="margin-bottom: 15px;">
            <el-row>
                <el-col class="head-tool">
                    
<div class="new_title fl"><strong><img src="/static/images/icon1.png" />学分完成情况统计列表</strong></div>
                    <span>
                        <btn :text="col.btnQuerystatistics" imgsrc="/static/images/search.png" linetype="4"
                            @click="onSubmit"></btn>
                    </span>
                </el-col>
            </el-row>
            <el-row>
                <el-col :xs="8" :sm="8" :md="6" :lg="6" :xl="6">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input size="mini">
                                <template slot="prepend">
                                    {{Creditcompletionstatistics.Particularyear+mark.m}}
                                </template>
                                <el-date-picker v-model="formInline.model.Particularyear" type="year" slot="suffix"
                                    size="mini" format="yyyy" value-format="yyyy" placeholder="选择年份">
                                </el-date-picker>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
            </el-row>
        </el-form>
        <el-row style="width:50%;float:left;">
            <span v-if="show">{{formInline.model.Particularyear}}年双总部人员学分完成百分比</span>
            <el-table ref="table" stripe :data="ListItem.tableData" :row-key="getRowKeys" :height="ListItem.tableHeight"
                border @selection-change="handleSelectionChange" row-style="height:10px"
                style="width: 100%;margin-top:20px;">
                <el-table-column type="selection" style="
                padding-top: 0px;
                padding-bottom: 0px;
                " align="center" width="55" :reserve-selection="true">
                </el-table-column>
                <el-table-column type="index" :label="col.SequenceNumber" :index="indexMethod" width="50"
                    show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="Completionratio" :label="Creditcompletionstatistics.Completionratio">
                </el-table-column>
                <el-table-column prop="Completionnumber" :label="Creditcompletionstatistics.Completionnumber">
                </el-table-column>
                <el-table-column prop="Percentage" :label="Creditcompletionstatistics.Percentage">
                </el-table-column>
                <el-table-column v-if="show" prop="Particularyear" :label="Creditcompletionstatistics.Particularyear">
                </el-table-column>
            </el-table>
            <el-row type="flex" justify="end" style="margin-top:10px;">
                <el-pagination ref="page" @size-change="handleSizeChange" @current-change="handleCurrentChange"
                    :current-page="ListItem.currentPage" :page-sizes="ListItem.pagesizes" :page-size="ListItem.pagesize"
                    :layout="ListItem.layout" :total="ListItem.total">
                </el-pagination>
            </el-row>
        </el-row>
        <el-row style="width:45%;float:right;">
            <span>{{Creditcompletionstatistics.Piechart+mark.m}}</span>
            <div id="main4" style="height:250px"></div>

        </el-row>
    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                show: false,
                value1: '',
                //表单内容
                ListItem: ListItem,
                //获取下拉菜单situation
                department: [],
                formInline: {
                    model: { Employeename: '', department: '' },
                    offset: 0,
                    limit: 10
                }
            },
            created: function () {
                //var currApp = this;
                //window.onresize = function () {
                //    currApp.ListItem.tableHeight = window.innerHeight -
                //        currApp.$refs.table.$el.offsetTop - 60;
                //    if (currApp.ListItem.tableHeight < 112) {
                //        currApp.ListItem.tableHeight = 112;
                //    }
                //}
            },
            updated: function () {
                if (this.formInline.model.Particularyear == undefined) {
                    this.show = false;
                } else {
                    this.show = true;
                }
            },
            mounted: function () {

                console.log(getDicDataArray(["01", "02", "03", "04"]))

                //获取下拉菜单内容
                this.department = getDicData('14');


                //初始化数据
                this.GetPageData(1);
                //列表高度自适应
                tablehigh(this);
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                yearCheck: function () {
                    if (this.formInline.model.Particularyear == undefined) {
                        this.show = false;
                    } else {
                        this.show = true;
                    }
                }
                ,
                indexMethod: function (index) {
                    return (this.ListItem.currentPage - 1) * this.ListItem.pagesize + index + 1;
                },
                //关闭Dialog 回调
                closeDialog: function () { closeDialog(this); },
                //删除方法
                onDelete: function () { onDelete(this, '/api/Creditcompletionstatistics/DeleteMuti'); },
                //列表选择触发
                handleSelectionChange: function (val) { handleSelectionChange(this, val); },
                //Dialog展示
                UserInput: function (val, id) { DialogShow(this, val, "CreditcompletionstatisticsInput.html", id); },
                //获取分页数据
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/Creditcompletionstatistics/GetList') },
                //查询方法
                onSubmit: function () { onSubmit(this); },
                //pagesize改变 触发方法
                handleSizeChange: function (val) { handleSizeChange(this, val); },
                //跳页触发方法
                handleCurrentChange: function (val) { handleCurrentChange(this, val); },
                //获取下拉菜单数据
                getDropDown: function () {
                }

            }
        });
    </script>
    <script type="text/javascript">
        var myChart4 = echarts.init(document.getElementById('main4'));

        option4 = {
            title: {
                text: '',
                subtext: '',

            },
            tooltip: {
                trigger: 'item',
                formatter: "{a} <br/>{b} : {c} ({d}%)"
            },
            legend: {
                orient: 'vertical',
                left: 'right',
                data: ['完成比例','完成人数','百分比']
            },
            series: [
                {
                    name: '访问来源',
                    type: 'pie',
                    radius: '75%',
                    center: ['50%', '50%'],
                    data: [
                        { value: 335, name: '完成比例' },
                        { value: 310, name: '完成人数' },
                        { value: 234, name: '百分比' },

                    ],
                    itemStyle: {
                        emphasis: {
                            shadowBlur: 10,
                            shadowOffsetX: 0,
                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    }
                }
            ]
        };


        myChart4.setOption(option4);
    </script>
</body>

</html>